package org.example.iris.service.impl;

import org.example.iris.mapper.InternshipEvaluationMapper;
import org.example.iris.service.InternshipEvaluationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class InternshipEvaluationServiceImpl implements InternshipEvaluationService {

    @Autowired
    private InternshipEvaluationMapper evaluationMapper;

    /**
     * 提交实习评价
     * @param studentId 学生id
     * @param companyId 企业id
     * @param evaluationScore 评价分数
     * @param comments 评价内容
     */
    @Override
    public void submitEvaluation(int studentId, int companyId, int evaluationScore, String comments) {
        // 调用 Mapper 插入数据
        evaluationMapper.insertEvaluation(studentId, companyId, evaluationScore, comments);
    }

    /**
     * 获取某学生对某公司的实习评价
     * @param studentId 学生id
     * @param companyId 企业id
     * @return 评价记录
     */
    @Override
    public Map<String, Object> getEvaluation(int studentId, int companyId) {
        // 调用 Mapper 获取评价
        return evaluationMapper.getEvaluation(studentId, companyId);
    }
}
